package com.sky.local_ads.fragment;

import java.util.List;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.sky.local_ads.adapter.StoreListAdapter;
import com.sky.local_ads.store_list.StoreDetails;
import com.sky.trueoffers.R;

public class BusinessListFragment extends Fragment {
	private StoreListAdapter storeAdapter;
	private ListView storeListView;
	private List<StoreDetails> businessDetailsList;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View rootView = inflater.inflate(R.layout.fragment_business_list, container, false);
		storeListView=(ListView)rootView.findViewById(R.id.storeList);
		
		return rootView;
	}
	
	public void setStoreList(List<StoreDetails> storeList) {
		this.businessDetailsList = storeList;
	}
	
	public void updateStoreList(){
		storeAdapter=new StoreListAdapter(getActivity(),businessDetailsList);
		storeListView.setAdapter(storeAdapter);
		storeAdapter.notifyDataSetChanged();
		Log.e(" list frag", " on update list");
		
	}
	
}
